/*
 * @lc app=leetcode.cn id=944 lang=typescript
 *
 * [944] 删列造序
 */

// @lc code=start
function minDeletionSize(strs: string[]): number {
    const len = strs[0].length;
    let count = 0;
    for (let i = 0; i < len; i++) {
        const arr = strs.map((chars) => chars[i]);
        for (let index = 1; index < arr.length; index++) {
            const prev = arr[index - 1];
            const element = arr[index];
            // 字符串比较是 ascii 比较
            if (prev > element) {
                count++;
                break;
            }
        }
    }
    return count;
}
// @lc code=end
